<?php
require_once("inc_security.php");
    $curImage=$_FILES['uploadfile']['name'];
    $extImage = substr(strrchr($curImage, '.'), 1);   
	$newImage = '1.'.$extImage;
	$uploadPath=$path.'Temp/'.$newImage; 
	$upload_action = copy($_FILES['uploadfile']['tmp_name'], $uploadPath);
	if (!$upload_action) {
		$result = 'error';
	}
	else{
		$result =$path.'Temp/'.$newImage;
        ImageHelper::ResizeKeepRatio($result, $result, 600, 400, $extImage);
	}
 echo $newImage;
?>
